import { IEvent } from './IEvent';
import { Task } from './Task';
import { TaskState } from './TaskState';

export abstract class BNode implements IEvent {
    public task: Task = new Task();
    public blackBoard: any = {};

    getState(): TaskState {
        return this.task.getState();
    }

    onStart(blackboard?: any): void {
        this.blackBoard = blackboard;
    }

    onUpdate(dt: number): void {}

    onEvent(event: string, data?: any) {}

    onCancel(): void {}

    onReset(): void {}
}
